(function(){"use strict";BX.namespace("BX.Landing");var e=BX.Landing.Utils.deepFreeze;var t=BX.Landing.Utils.style;var n=BX.Landing.Utils.insertAfter;var i=BX.Landing.Utils.insertBefore;var s=BX.Landing.Utils.append;var a=BX.Landing.Utils.isPlainObject;var o=BX.Landing.Utils.isBoolean;var r=BX.Landing.Utils.isNumber;var c=BX.Landing.Utils.isString;var d=BX.Landing.Utils.isArray;var l=BX.Landing.Utils.isEmpty;var h=BX.Landing.Utils.addClass;var u=BX.Landing.Utils.removeClass;var g=BX.Landing.Utils.hasClass;var f=BX.Landing.Utils.toggleClass;var m=BX.Landing.Utils.create;var p=BX.Landing.Utils.debounce;var B=BX.Landing.Utils.throttle;var v=BX.Landing.Utils.fireCustomEvent;var b=BX.Landing.Utils.onCustomEvent;var L=BX.Landing.Utils.bind;var y=BX.Landing.Utils.unbind;var k=BX.Landing.Utils.getClass;var C=BX.Landing.Utils.rect;var I=BX.Landing.Utils.setTextContent;var X=BX.Landing.Utils.translateY;var _=BX.Landing.Utils.nextSibling;var T=BX.Landing.Utils.prevSibling;var A=BX.Landing.Utils.join;var E=BX.Landing.Utils.slice;var O=BX.Landing.Utils.decodeDataValue;var M=BX.Landing.Utils.encodeDataValue;var w=BX.Landing.Utils.data;var N=BX.Landing.Utils.attr;var S=BX.Landing.Utils.removePanels;var P=BX.Landing.Utils.getCSSSelector;var F=BX.Landing.Utils.remove;var D=BX.Landing.Utils.clone;var U=BX.Landing.Utils.trim;var x=BX.Landing.Utils.prepend;var j=BX.Landing.Utils.random;var R=BX.Landing.Utils.htmlToElement;var V=BX.Landing.Utils.proxy;var G=BX.Landing.Utils.escapeText;var K=BX.Landing.Utils.isValidElementId;var q=BX.Landing.Collection.BaseCollection;var H=BX.Landing.Collection.NodeCollection;var W=BX.Landing.UI.Collection.FormCollection;var Y=BX.Landing.Collection.CardCollection;var z=BX.Landing.UI.Collection.PanelCollection;var J=BX.Landing.UI.Panel.BaseButtonPanel;var Q=BX.Landing.UI.Panel.CardAction;var Z=BX.Landing.UI.Panel.ContentEdit;var $=BX.Landing.UI.Button.BaseButton;var ee=BX.Landing.UI.Button.ActionButton;var te=BX.Landing.UI.Button.Plus;var ne=BX.Landing.UI.Button.CardAction;var ie=BX.Landing.UI.Factory.StyleFactory;var se=BX.Landing.UI.Form.BaseForm;var ae=BX.Landing.UI.Form.StyleForm;var oe=BX.Landing.UI.Form.CardForm;var re=BX.Landing.UI.Form.CardsForm;var ce=BX.Landing.Group;var de=BX.Landing.Event.Block;var le=BX.Landing.UI.Card.TabCard;var he=BX.Landing.UI.Card.DynamicFieldsGroup;var ue="D";var ge="V";var fe="W";var me="X";function pe(e){let t=BX.Landing.Main.getInstance();let n=Object.keys(t.options.style);for(let i=0;i<n.length;i++){let s=n[i];let a=t.options.style[s]["style"][e];if(!a){continue}a.attrKey=e;if(e==="background"){a.items=a.items.concat(t.options.style[s]["style"]["background-overlay"].items)}return a}return null}function Be(e){let t=BX.Landing.Main.getInstance();let n=Object.keys(t.options.attrs);for(let i=0;i<n.length;i++){let s=n[i];let a=t.options.attrs[s]["attrs"][e];if(!a){continue}a.attrKey=e;return a}return{}}function ve(e){let t=BX.Landing.Main.getInstance();let n=Object.keys(t.options.style);for(let i=0;i<n.length;i++){let s=n[i];if(!t.options.style[s]["group"]){continue}if(e in t.options.style[s]["group"]){return true}}return false}function be(e){let t=BX.Landing.Main.getInstance();let n=Object.keys(t.options.style);for(let i=0;i<n.length;i++){let s=n[i];if(!t.options.style[s]["group"]){continue}if(t.options.style[s]["group"][e]){return t.options.style[s]["group"][e]}}return[]}function Le(e){if(!!e){if(!e.loader){e.loader=new BX.Loader({target:e.layout,size:16});void t(e.loader.layout.querySelector(".main-ui-loader-svg-circle"),{"stroke-width":"4px"})}e.loader.show();h(e.text,"landing-ui-hide-icon")}}function ye(e){if(!!e){if(e.loader){e.loader.hide();u(e.text,"landing-ui-hide-icon")}}}function ke(e){return!!e&&e.includes("@")}var Ce=BX.debounce((function(){BX.Landing.PageObject.getBlocks().forEach((function(e){e.adjustSortButtonsState()}))}),400);b("BX.Landing.Block:init",Ce);BX.Landing.Block=function(t,n){this.node=t;this.parent=t.parentElement;this.content=t.firstElementChild;this.siteId=w(t.parentElement,"data-site");this.lid=w(t.parentElement,"data-landing");this.id=r(parseInt(n.id))?parseInt(n.id):0;this.selector=A("#block",r(n.id)?n.id:0," > :first-child");this.repoId=r(n.repoId)?n.repoId:null;this.active=o(n.active)?n.active:true;this.allowedByTariff=o(n.allowedByTariff)?n.allowedByTariff:true;this.manifest=a(n.manifest)?n.manifest:{};this.manifest.nodes=a(n.manifest.nodes)?n.manifest.nodes:{};this.manifest.cards=a(n.manifest.cards)?n.manifest.cards:{};this.manifest.attrs=a(n.manifest.attrs)?n.manifest.attrs:{};this.onStyleInputWithDebounce=p(this.onStyleInput,300,this);this.changeTimeout=null;this.php=n.php;this.designed=n.designed;this.access=n.access;this.anchor=n.anchor;this.savedAnchor=n.anchor;this.requiredUserActionOptions=n.requiredUserAction;this.dynamicParams=n.dynamicParams||{};this.sections=n.sections?n.sections.split(","):[];this.nodes=new H;this.cards=new Y;this.panels=new z;this.groups=new q;this.changedNodes=new q;this.styles=new q;this.forms=new W;this.menu=[];if(a(this.requiredUserActionOptions)&&!l(this.requiredUserActionOptions)){this.showRequiredUserAction(this.requiredUserActionOptions);this.requiredUserActionIsShown=true}this.onEditorEnabled=this.onEditorEnabled.bind(this);this.onEditorDisabled=this.onEditorDisabled.bind(this);this.adjustPanelsPosition=this.adjustPanelsPosition.bind(this);this.onMouseMove=this.onMouseMove.bind(this);this.onStorage=this.onStorage.bind(this);this.onBlockRemove=this.onBlockRemove.bind(this);e(this.manifest);this.node.classList[this.active?"remove":"add"]("landing-block-disabled");this.state="ready";this.initPanels();this.initStyles();this.initMenu();this.adjustContextSensitivityStyles();var i=BX.Landing.Env.getInstance().getOptions();var s=i.specialType;if(this.isDefaultCrmFormBlock()){var c={formId:i.formEditorData.formOptions.id,formOptions:this.getCrmFormOptions(),block:this,showWithOptions:true};var d=new BX.Uri(window.top.location.toString());if(BX.Text.toBoolean(d.getQueryParam("formCreated"))){c.state="presets"}void BX.Landing.UI.Panel.FormSettingsPanel.getInstance().show(c)}BX.Landing.PageObject.getBlocks().push(this);var h={};if(this.requiredUserActionIsShown){h.requiredUserActionIsShown=true;h.layout=this.node.firstElementChild;h.button=this.node.firstElementChild.querySelector(".ui-btn")}v(window,"BX.Landing.Block:init",[this.createEvent({data:h})]);b("BX.Landing.Editor:enable",this.onEditorEnabled);b("BX.Landing.Editor:disable",this.onEditorDisabled);b("BX.Landing.Block:afterRemove",this.onBlockRemove);L(this.node,"mousemove",this.onMouseMove);L(this.node,"keydown",this.adjustPanelsPosition);L(top,"storage",this.onStorage)};BX.Landing.Block.storage=new BX.Landing.Collection.BlockCollection;BX.Landing.Block.prototype={onMouseMove:function(){if(this.state==="ready"){y(this.node,"mousemove",this.onMouseMove);this.initEntities();this.lazyInitPanels();this.state="complete"}},getBlockNode:function(){return this.node},isAllowedByTariff:function(){return this.allowedByTariff},showRequiredUserAction:function(e){let t=this.node;if(e.targetNodeSelector){t=this.node.querySelector(e.targetNodeSelector)}t.innerHTML='<div class="landing-block-user-action">'+'<div class="landing-block-user-action-inner">'+(e.header?"<h3>"+'<i class="fa fa-exclamation-triangle g-mr-15"></i>'+e.header+"</h3><hr>":"")+(e.description?"<p>"+e.description+"</p>":"")+((e.href||e.onClick||e.className)&&e.text?"<div>"+'<a href="'+e.href+'" class="landing-trusted-link ui-btn '+e.className+'" target="'+(e.target?e.target:"")+'">'+e.text+"</a>"+"</div>":"")+"</div>"+"</div>";if(e.onClick){var n=t.querySelector(".landing-block-user-action .ui-btn");L(n,"click",(function(t){t.preventDefault();try{BX.evalGlobal(e.onClick)}catch(e){console.error(e)}}))}},disableLinks:function(){var e="a:not([class*='landing-ui']):not(.landing-trusted-link), .btn:not([class*='landing-ui']):not(.landing-trusted-link), button:not([class*='landing-ui']):not(.landing-trusted-link), input:not([class*='landing-ui'])";var t=E(this.content.querySelectorAll(e));t.forEach((function(e){var t=this.nodes.some((function(t){return t.node.contains(e)}));var n=this.menu.some((function(t){return t.root.contains(e)}));if(!this.nodes.getByNode(e)&&!t&&!n){e.style.pointerEvents="none"}}),this)},adjustContextSensitivityStyles:function(){if(g(this.parent,"landing-sidebar")){if(!g(this.content,"landing-adjusted")){var e=Object.keys(this.manifest.style.nodes);var t=e.filter((function(e){return!!this.manifest.style.nodes[e].type&&this.manifest.style.nodes[e].type.indexOf("columns")!==-1}),this);if(l(t)){return}var n=pe("columns");if(n===null){return}t.forEach((function(e){var t=this.styles.get(e);if(t){t.setIsSelectGroup(true);t.setValue("col-lg-12",n.items);t.unsetIsSelectGroupFlag()}}),this);var i=this.styles.get(this.selector);if(i){i.setValue("landing-adjusted",["landing-adjusted"])}this.saveStyles()}}},forceInit:function(){this.onMouseMove()},createEvent:function(e){return new de({block:this.node,node:!!e&&!!e.node?e.node:null,card:!!e&&!!e.card?e.card:null,data:!!e&&e.data||{},onForceInit:this.forceInit.bind(this)})},initEntities:function(){this.initCards();this.initNodes();this.initGroups();this.disableLinks()},initMenu:function(){if(BX.type.isPlainObject(this.manifest.menu)){this.menu=Object.entries(this.manifest.menu).map((function(e){var t=e[0];var n=e[1];return new BX.Landing.Menu.Menu({code:t,root:this.node.querySelector(t),manifest:n,block:this.id})}),this)}},initCardsLabels:function(){this.cards.forEach((function(e){e.label=this.createCardLabel(e.node,e.manifest)}),this)},initGroups:function(){var e=[];var t=a(this.manifest.groups)?this.manifest.groups:{};this.nodes.forEach((function(t){if(c(t.manifest.group)&&!e.includes(t.manifest.group)){e.push(t.manifest.group)}}));e.forEach((function(e){var n=this.nodes.filter((function(t){return t.manifest.group===e})).reduce((function(e,t){var n=parseInt(t.selector.split("@")[1]);if(!e[n]){e[n]=new H}e[n].push(t);return e}),{});Object.keys(n).forEach((function(i){this.groups.add(new ce({id:e,name:t[e],nodes:n[i],onClick:this.onGroupClick.bind(this)}))}),this)}),this)},onGroupClick:function(e){if(!BX.Landing.UI.Panel.StylePanel.getInstance().isShown()){this.showContentPanel({name:e.name,nodes:e.nodes,compact:true,nodesOnly:true,showAll:true,hideCheckbox:true})}},initPanels:function(){if(!this.panels.get("create_action")){var e=new J("create_action","landing-ui-panel-create-action");e.addButton(new te("insert_after",{text:BX.Landing.Loc.getMessage("ACTION_BUTTON_CREATE"),onClick:B(this.addBlockAfterThis,600,this)}));e.show();this.addPanel(e);if(this.isCrmFormPage()){var t=new J("create_before_action","landing-ui-panel-create-before-action");t.addButton(new te("insert_before",{text:BX.Landing.Loc.getMessage("ACTION_BUTTON_CREATE"),onClick:B(this.addBlockBeforeThis,600,this)}));t.show();this.addPanel(t)}e.buttons[0].on("mouseover",this.onCreateButtonMouseover.bind(this));e.buttons[0].on("mouseout",this.onCreateButtonMouseout.bind(this))}},isLastChildInArea:function(){return this.parent.querySelector("[class*='block-wrapper']:last-of-type")===this.node},onCreateButtonMouseover:function(){if(this.isLastChildInArea()||g(this.parent,"landing-header")||g(this.parent,"landing-footer")){var e=BX.Landing.Main.getInstance().getLayoutAreas();if(e.length>1){var t=this.panels.get("create_action");var n=t.buttons.get("insert_after");switch(true){case g(this.parent,"landing-main"):n.setText([BX.Landing.Loc.getMessage("ACTION_BUTTON_CREATE"),BX.Landing.Loc.getMessage("LANDING_ADD_BLOCK_TO_MAIN")].join(" "));break;case g(this.parent,"landing-header"):n.setText([BX.Landing.Loc.getMessage("ACTION_BUTTON_CREATE"),BX.Landing.Loc.getMessage("LANDING_ADD_BLOCK_TO_HEADER")].join(" "));break;case g(this.parent,"landing-sidebar"):n.setText([BX.Landing.Loc.getMessage("ACTION_BUTTON_CREATE"),BX.Landing.Loc.getMessage("LANDING_ADD_BLOCK_TO_SIDEBAR")].join(" "));break;case g(this.parent,"landing-footer"):n.setText([BX.Landing.Loc.getMessage("ACTION_BUTTON_CREATE"),BX.Landing.Loc.getMessage("LANDING_ADD_BLOCK_TO_FOOTER")].join(" "));break}clearTimeout(this.fadeTimeout);this.fadeTimeout=setTimeout(function(){h(this.parent,"landing-area-highlight");e.forEach((function(e){if(e!==this.parent){h(e,"landing-area-fade")}}),this)}.bind(this),400)}}},onCreateButtonMouseout:function(){clearTimeout(this.fadeTimeout);if(this.isLastChildInArea()||g(this.parent,"landing-header")||g(this.parent,"landing-footer")){var e=BX.Landing.Main.getInstance().getLayoutAreas();if(e.length>1){var t=this.panels.get("create_action").buttons[0];t.setText(BX.Landing.Loc.getMessage("ACTION_BUTTON_CREATE"));u(this.parent,"landing-area-highlight");e.forEach((function(e){u(e,"landing-area-fade")}),this)}}},isInSidebar:function(){return!!this.node.closest(".landing-sidebar")},initSidebarActionPanel:function(){if(this.isInSidebar()&&!this.panels.contains("sidebar_actions")){var e=new J("sidebar_actions","landing-ui-panel-sidebar-actions");e.addButton(new ee("showSidebarActions",{onClick:this.onShowSidebarActionsClick.bind(this)}));this.addPanel(e);e.show()}},showFeedbackForm:function(){BX.Landing.Main.getInstance().showSliderFeedbackForm({blockName:this.manifest.block.name,blockCode:this.manifest.code,blockSection:this.manifest.block.section,landingId:BX.Landing.Main.getInstance().id,target:"blockActions"});if(this.blockActionsMenu){this.blockActionsMenu.close()}if(this.sidebarActionsMenu){this.sidebarActionsMenu.close()}},onShowSidebarActionsClick:function(e){var t=this.panels.get("sidebar_actions").buttons.get("showSidebarActions");if(!this.sidebarActionsMenu){this.sidebarActionsMenu=BX.Main.MenuManager.create({id:this.id+"_sidebar_actions",bindElement:t.layout,className:"landing-ui-block-actions-popup",angle:{position:"top",offset:95},offsetTop:-6,offsetLeft:-26,events:{onPopupClose:function(){this.panels.get("sidebar_actions").buttons.get("showSidebarActions").deactivate();u(this.node,"landing-ui-hover")}.bind(this)},items:[function(){if((a(this.manifest.nodes)||a(this.manifest.attrs))&&this.isAllowedByTariff()){return new BX.Main.MenuItem({id:"content",text:BX.Landing.Loc.getMessage("ACTION_BUTTON_CONTENT"),onclick:function(){this.onShowContentPanel();this.sidebarActionsMenu.close()}.bind(this)})}}.bind(this)(),function(){if(a(this.manifest.style)&&this.isAllowedByTariff()){return new BX.Main.MenuItem({id:"style",text:BX.Landing.Loc.getMessage("ACTION_BUTTON_STYLE"),onclick:function(){this.onStyleShow();this.sidebarActionsMenu.close()}.bind(this),className:this.access<ge?"landing-ui-disabled":""})}}.bind(this)(),function(){if(a(this.manifest.style)&&this.isAllowedByTariff()){return new BX.Main.MenuItem({id:"designblock",text:BX.Landing.Loc.getMessage("LANDING_BLOCKS_ACTIONS_DESIGN_BLOCK"),className:!this.isDesignBlockAllowed()?"landing-ui-disabled":"",onclick:function(){this.onDesignerBlockClick();this.sidebarActionsMenu.close()}.bind(this)})}}.bind(this)(),function(){if(this.isAllowedByTariff()){return new BX.Main.MenuItem({delimiter:true})}}.bind(this)(),function(){var e=BX.Landing.Main.getInstance().options.placements.blocks;if(a(e)&&(this.manifest.code in e||e["*"])){var t=[];if(this.manifest.code in e){Object.keys(e[this.manifest.code]).forEach((function(n){t.push(e[this.manifest.code][n])}),this)}if(e["*"]){Object.keys(e["*"]).forEach((function(n){t.push(e["*"][n])}),this)}if(t.length){if(typeof BX.Landing.PageObject.getRootWindow().BX.rest!=="undefined"&&typeof BX.Landing.PageObject.getRootWindow().BX.rest.AppLayout!=="undefined"){var n=["*",this.manifest.code];for(var i=0,s=n.length;i<s;i++){var o=BX.Landing.PageObject.getRootWindow().BX.rest.AppLayout.initializePlacement("LANDING_BLOCK_"+n[i]);if(o){o.prototype.refreshBlock=function(e,t){var n=BX.Landing.PageObject.getBlocks().get(e.id);if(n){n.reload().then(t)}}}}}return new BX.Main.MenuItem({id:"actions",text:BX.Landing.Loc.getMessage("ACTION_BUTTON_CONTENT_MORE"),items:t.map((function(e){return new BX.Main.MenuItem({id:"placement_"+e.id+"_"+j(),text:M(e.title),onclick:this.onPlacementClick.bind(this,e)})}),this),className:this.access<ge?"landing-ui-disabled":""})}}}.bind(this)(),new BX.Main.MenuItem({id:"down",text:BX.Landing.Loc.getMessage("LANDING_TITLE_OF_BLOCK_ACTION_SORT_DOWN"),onclick:function(){this.moveDown();this.sidebarActionsMenu.close()}.bind(this)}),new BX.Main.MenuItem({id:"up",text:BX.Landing.Loc.getMessage("LANDING_TITLE_OF_BLOCK_ACTION_SORT_UP"),onclick:function(){this.moveUp();this.sidebarActionsMenu.close()}.bind(this)}),new BX.Main.MenuItem({delimiter:true}),new BX.Main.MenuItem({id:"show_hide",text:BX.Landing.Loc.getMessage(this.isEnabled()?"ACTION_BUTTON_HIDE":"ACTION_BUTTON_SHOW"),className:!this.isChangeStateBlockAllowed()?"landing-ui-disabled":"",onclick:function(){this.onStateChange();this.sidebarActionsMenu.close()}.bind(this)}),new BX.Main.MenuItem({delimiter:true}),new BX.Main.MenuItem({text:BX.Landing.Loc.getMessage("ACTION_BUTTON_ACTIONS_CUT"),className:!this.isRemoveBlockAllowed()?"landing-ui-disabled":"",onclick:function(){BX.Landing.Main.getInstance().onCutBlock.bind(BX.Landing.Main.getInstance(),this)();this.sidebarActionsMenu.close()}.bind(this)}),new BX.Main.MenuItem({text:BX.Landing.Loc.getMessage("ACTION_BUTTON_ACTIONS_COPY"),onclick:function(){BX.Landing.Main.getInstance().onCopyBlock.bind(BX.Landing.Main.getInstance(),this)();this.sidebarActionsMenu.close()}.bind(this)}),new BX.Main.MenuItem({id:"block_paste",text:BX.Landing.Loc.getMessage("ACTION_BUTTON_ACTIONS_PASTE"),title:window.localStorage.landingBlockName,className:this.isPasteBlockAllowed()?"":"landing-ui-disabled",onclick:function(){BX.Landing.Main.getInstance().onPasteBlock.bind(BX.Landing.Main.getInstance(),this)();this.sidebarActionsMenu.close()}.bind(this)}),new BX.Main.MenuItem({delimiter:true}),new BX.Main.MenuItem({text:BX.Landing.Loc.getMessage("LANDING_BLOCKS_ACTIONS_FEEDBACK_BUTTON"),onclick:this.showFeedbackForm.bind(this)}),new BX.Main.MenuItem({text:BX.Landing.Loc.getMessage("LANDING_BLOCKS_ACTIONS_SAVE_BLOCK_BUTTON_MSGVER_1"),className:!this.isSaveBlockInLibraryAllowed()?"landing-ui-disabled":"",onclick:function(){this.saveBlock();this.sidebarActionsMenu.close()}.bind(this)}),new BX.Main.MenuItem({delimiter:true}),new BX.Main.MenuItem({id:"remove",text:BX.Landing.Loc.getMessage("LANDING_TITLE_OF_BLOCK_ACTION_REMOVE"),onclick:function(){this.deleteBlock();this.sidebarActionsMenu.close()}.bind(this),className:!this.isRemoveBlockAllowed()?"landing-ui-disabled":""})]})}this.sidebarActionsMenu.show();h(this.node,"landing-ui-hover")},lazyInitPanels:function(){if(this.isInSidebar()){this.initSidebarActionPanel()}var e=BX.Landing.Main.getInstance().options.placements.blocks;if(!this.panels.contains("content_actions")&&(a(this.manifest.nodes)&&!l(this.manifest.nodes)||a(this.manifest.style)&&!l(this.manifest.style)||a(e)&&!l(e))){var t=new J("content_actions","landing-ui-panel-content-action");t.addButton(new ee("collapse",{html:"<span class='fas fa-caret-right'></span>",onClick:this.onCollapseActionPanel.bind(this),attrs:{title:BX.Landing.Loc.getMessage("LANDING_TITLE_OF_BLOCK_ACTION_COLLAPSE")},separate:true}));if(this.isAllowedByTariff()){if(a(this.manifest.style)){t.addButton(new ee("designblock",{text:BX.Landing.Loc.getMessage("LANDING_BLOCKS_ACTIONS_DESIGN_BLOCK"),onClick:this.onDesignerBlockClick.bind(this),disabled:!this.isDesignBlockAllowed(),attrs:{title:BX.Landing.Loc.getMessage("LANDING_BLOCKS_ACTIONS_DESIGN_BLOCK")},separate:true}));t.addButton(new ee("style",{text:BX.Landing.Loc.getMessage("ACTION_BUTTON_STYLE"),onClick:this.onStyleShow.bind(this),disabled:!this.isStyleModifyAllowed(),attrs:{title:BX.Landing.Loc.getMessage("LANDING_TITLE_OF_BLOCK_DESIGN")},separate:true}))}if(a(this.manifest.nodes)||a(this.manifest.attrs)){t.addButton(new ee("content",{text:BX.Landing.Loc.getMessage("ACTION_BUTTON_CONTENT"),onClick:this.onShowContentPanel.bind(this),attrs:{title:BX.Landing.Loc.getMessage("LANDING_TITLE_OF_BLOCK_EDIT")},separate:true}))}}else{t.addButton(new ee("expired",{text:BX.Landing.Loc.getMessage("ACTION_BUTTON_EXPIRED"),separate:true}))}if(a(e)&&(this.manifest.code in e||e["*"])){var n=[];if(this.manifest.code in e){Object.keys(e[this.manifest.code]).forEach((function(t){n.push(e[this.manifest.code][t])}),this)}if(e["*"]){Object.keys(e["*"]).forEach((function(t){n.push(e["*"][t])}),this)}if(n.length){t.addButton(new ee("actions",{html:BX.Landing.Loc.getMessage("ACTION_BUTTON_CONTENT_MORE"),onClick:this.onPlacementButtonClick.bind(this,n),separate:true}));if(typeof BX.Landing.PageObject.getRootWindow().BX.rest!=="undefined"&&typeof BX.Landing.PageObject.getRootWindow().BX.rest.AppLayout!=="undefined"){var i=["*",this.manifest.code];for(var s=0,o=i.length;s<o;s++){var r=BX.Landing.PageObject.getRootWindow().BX.rest.AppLayout.initializePlacement("LANDING_BLOCK_"+i[s]);if(r){r.prototype.refreshBlock=function(e,t){var n=BX.Landing.PageObject.getBlocks().get(e.id);if(n){n.reload().then(t)}}}}}}}if(a(this.manifest.style)){var c=new ee("block_display_info",{html:"&nbsp;",separate:true,onClick:this.onStyleShow.bind(this)});L(c.layout,"mouseenter",this.onBlockDisplayMouseenter.bind(this));L(c.layout,"mouseleave",this.onBlockDisplayMouseleave.bind(this));t.addButton(c)}t.show();this.addPanel(t)}if(!this.panels.get("block_action")){var d=new J("block_action","landing-ui-panel-block-action");var h=this.getBlockFromRepository(this.manifest.code);if(h&&h.restricted){var u=new ee("restricted",{html:"!",className:"landing-ui-block-restricted-button",onClick:this.onRestrictedButtonClick.bind(this),separate:true});L(u.layout,"mouseenter",this.onRestrictedButtonMouseenter.bind(this));L(u.layout,"mouseleave",this.onRestrictedButtonMouseleave.bind(this));d.addButton(u)}d.addButton(new ee("down",{html:BX.Landing.Loc.getMessage("ACTION_BUTTON_DOWN"),onClick:this.moveDown.bind(this),attrs:{title:BX.Landing.Loc.getMessage("LANDING_TITLE_OF_BLOCK_ACTION_SORT_DOWN")}}));d.addButton(new ee("up",{html:BX.Landing.Loc.getMessage("ACTION_BUTTON_UP"),onClick:this.moveUp.bind(this),attrs:{title:BX.Landing.Loc.getMessage("LANDING_TITLE_OF_BLOCK_ACTION_SORT_UP")}}));d.addButton(new ee("actions",{html:BX.Landing.Loc.getMessage("ACTION_BUTTON_ACTIONS"),onClick:this.showBlockActionsMenu.bind(this),attrs:{title:BX.Landing.Loc.getMessage("LANDING_TITLE_OF_BLOCK_ACTION_ADDITIONAL_ACTIONS")}}));d.addButton(new ee("remove",{html:BX.Landing.Loc.getMessage("ACTION_BUTTON_REMOVE"),disabled:!this.isRemoveBlockAllowed(),onClick:this.deleteBlock.bind(this),attrs:{title:BX.Landing.Loc.getMessage("LANDING_TITLE_OF_BLOCK_ACTION_REMOVE")}}));d.addButton(new ee("collapse",{html:"<span class='fas fa-caret-right'></span>",onClick:this.onCollapseActionPanel.bind(this),attrs:{title:BX.Landing.Loc.getMessage("LANDING_TITLE_OF_BLOCK_ACTION_COLLAPSE")},separate:true}));d.show();this.addPanel(d)}this.adjustPanelsPosition();this.adjustSortButtonsState()},onCollapseActionPanel:function(){f(this.parent,"landing-ui-collapse")},getBlockFromRepository:function(e){var t=BX.Landing.Main.getInstance().options.blocks;var n=Object.keys(t);var i=n.find((function(n){return e in t[n].items}));if(i){return t[i].items[e]}},onRestrictedButtonClick:function(e){e.preventDefault()},onPlacementClick:function(e){BX.rest.AppLayout.openApplication(e.app_id,{ID:this.id,CODE:this.manifest.code,LID:BX.Landing.Main.getInstance().id},{PLACEMENT:"LANDING_BLOCK_"+e.placement,PLACEMENT_ID:e.id});if(this.blockPlacementsActionsMenu){this.blockPlacementsActionsMenu.close()}},onPlacementButtonClick:function(e){this.panels.get("content_actions").buttons.get("actions").activate();if(!this.blockPlacementsActionsMenu){var t=this.panels.get("content_actions").buttons.get("actions");var n=A("block_",this.id,"content_placement_actions_",j());var i=e.map((function(e){return new BX.Main.MenuItem({id:"placement_"+(e.id||j())+"_"+j(),text:M(e.title),disabled:e.disabled===true,onclick:typeof e.onClick==="function"?e.onClick:this.onPlacementClick.bind(this,e)})}),this);this.blockPlacementsActionsMenu=new BX.PopupMenuWindow({id:n,bindElement:t.layout,items:i,angle:{position:"top",offset:80},offsetTop:-6,events:{onPopupClose:function(){this.panels.get("content_actions").buttons.get("actions").deactivate();u(this.node,"landing-ui-hover")}.bind(this)}})}h(this.node,"landing-ui-hover");this.blockPlacementsActionsMenu.show()},onDesignerBlockClick:function(){var e=null;BX.Landing.Backend.getInstance().action("Block::getContent",{block:this.id,lid:this.lid,siteId:this.siteId,editMode:1}).then((function(t){e=t.content}));var t=BX.Landing.Env.getInstance().getOptions();var n=t.params.sef_url["design_block"].replace("__block_id__",this.id).replace("__site_show__",this.siteId).replace("__landing_edit__",this.lid)+"&code="+this.manifest.code+"&designed="+(this.designed?"Y":"N")+"&deviceCode="+BX.Landing.Main.getInstance().getDeviceCode();BX.SidePanel.Instance.open(n,{cacheable:false,allowChangeHistory:false,requestMethod:"post",customLeftBoundary:40,events:{onClose:function(t){BX.Landing.Backend.getInstance().action("Block::getContent",{block:this.id,lid:this.lid,siteId:this.siteId,editMode:1}).then(function(t){var n=t.content;if(e!==n){BX.Landing.History.getInstance().push();this.reload().then(function(){v("BX.Landing.Block:onDesignerBlockSave",[this.id])}.bind(this));var i=new BX.Landing.Metrika(true);i.sendLabel(null,"designerBlock","close"+"&designed="+(this.designed?"Y":"N")+"&code="+this.manifest.code)}}.bind(this))}.bind(this)}});if(this.blockPlacementsActionsMenu){this.blockPlacementsActionsMenu.close()}},isDesignBlockAllowed:function(){return!(this.access<fe||this.php||this.isCrmFormPage()&&this.isCrmFormBlock())},isStyleModifyAllowed:function(){return!(this.access<ge||l(this.manifest.style))},isEditBlockAllowed:function(){return this.access>=fe},isRemoveBlockAllowed:function(){return!(this.access<me||this.isCrmFormBlock()&&this.isDefaultCrmFormBlock())},isPasteBlockAllowed:function(){return window.localStorage.landingBlockId&&!this.isDefaultCrmFormBlock()},isSaveBlockInLibraryAllowed:function(){return!this.isDefaultCrmFormBlock()},isChangeStateBlockAllowed:function(){return!(this.access<fe||this.isDefaultCrmFormBlock())},saveBlock:function(){BX.Landing.Main.getInstance().showSaveBlock(this)},onRestrictedButtonMouseenter:function(e){clearTimeout(this.displayBlockTimer);this.displayBlockTimer=setTimeout(function(e){BX.Landing.UI.Tool.Suggest.getInstance().show(e,{description:BX.Landing.Loc.getMessage("LANDING_BLOCK_RESTRICTED_TEXT")})}.bind(this),200,e.currentTarget)},onRestrictedButtonMouseleave:function(){clearTimeout(this.displayBlockTimer);BX.Landing.UI.Tool.Suggest.getInstance().hide()},onBlockDisplayMouseenter:function(e){clearTimeout(this.displayBlockTimer);this.displayBlockTimer=setTimeout(function(e){BX.Landing.UI.Tool.Suggest.getInstance().show(e,{name:m("div",{props:{className:"landing-ui-block-display-message-header"},html:BX.Landing.Loc.getMessage("LANDING_BLOCK_DISABLED_ON_DESKTOP_NAME_2")}).outerHTML,description:this.getBlockDisplayItems()})}.bind(this),300,e.currentTarget)},onBlockDisplayMouseleave:function(){clearTimeout(this.displayBlockTimer);BX.Landing.UI.Tool.Suggest.getInstance().hide()},getBlockDisplayItems:function(){function e(e){return m("div",{props:{className:"landing-ui-block-display-message"},attrs:{"data-mod":e},children:[m("div",{props:{className:"landing-ui-block-display-message-left"},html:"&nbsp;"}),m("div",{props:{className:"landing-ui-block-display-message-right"},children:[m("p",{html:BX.Landing.Loc.getMessage("LANDING_BLOCK_HIDDEN_ON_"+(e?e.toUpperCase():""))})]})]})}var t=m("div");if(g(this.content,"l-d-lg-none")){t.appendChild(e("desktop"))}if(g(this.content,"l-d-md-none")){t.appendChild(e("tablet"))}if(g(this.content,"l-d-xs-none")){t.appendChild(e("mobile"))}return t.outerHTML},adjustPanelsPosition:function(){var e=C(this.node);var t=this.panels.get("content_actions");var n=this.panels.get("block_action");var i=e.height<80?h:u;if(t){i(t.layout,"landing-ui-panel-actions-compact")}if(n){i(n.layout,"landing-ui-panel-actions-compact")}},onEditorEnabled:function(e){if(this.node.contains(e)){h(this.node,"landing-ui-hover")}},onEditorDisabled:function(){u(this.node,"landing-ui-hover")},onStorage:function(){var e=this.blockActionsMenu||this.sidebarActionsMenu;if(e){var t=e.getMenuItem("block_paste");if(t){if(window.localStorage.landingBlockId){t.layout.item.setAttribute("title",window.localStorage.landingBlockName);u(t.layout.item,"landing-ui-disabled");h(t.layout.item,"menu-popup-no-icon")}else{t.layout.item.setAttribute("title","");h(t.layout.item,"landing-ui-disabled")}}}},showBlockActionsMenu:function(){this.panels.get("block_action").buttons.get("actions").activate();if(!this.blockActionsMenu){var e=g(this.node.parentElement,"landing-sidebar");var t=this.panels.get("block_action").buttons.get("actions");var n=A("block_",this.id,"_actions_",j());var i=BX.Landing.Main.getInstance();this.blockActionsMenu=new BX.PopupMenuWindow({id:n,bindElement:t.layout,className:"landing-ui-block-actions-popup",angle:{position:"top",offset:e?70:146},offsetTop:-6,offsetLeft:-26,events:{onPopupClose:function(){this.panels.get("block_action").buttons.get("actions").deactivate();u(this.node,"landing-ui-hover")}.bind(this),onPopupShow:function(){BX.Event.EventEmitter.emit("BX.Landing.PopupMenuWindow:onShow")}.bind(this)},items:[new BX.Main.MenuItem({id:"show_hide",text:BX.Landing.Loc.getMessage(this.isEnabled()?"ACTION_BUTTON_HIDE":"ACTION_BUTTON_SHOW"),className:!this.isChangeStateBlockAllowed()?"landing-ui-disabled":"",onclick:function(){this.onStateChange();this.blockActionsMenu.close()}.bind(this)}),new BX.Main.MenuItem({text:BX.Landing.Loc.getMessage("ACTION_BUTTON_ACTIONS_CUT"),className:!this.isRemoveBlockAllowed()?"landing-ui-disabled":"",onclick:function(){i.onCutBlock.bind(i,this)();this.blockActionsMenu.close()}.bind(this)}),new BX.Main.MenuItem({text:BX.Landing.Loc.getMessage("ACTION_BUTTON_ACTIONS_COPY"),className:this.isDefaultCrmFormBlock()?"landing-ui-disabled":"",onclick:function(){i.onCopyBlock.bind(i,this)();this.blockActionsMenu.close()}.bind(this)}),new BX.Main.MenuItem({id:"block_paste",text:BX.Landing.Loc.getMessage("ACTION_BUTTON_ACTIONS_PASTE"),title:window.localStorage.landingBlockName,className:this.isPasteBlockAllowed()?"":"landing-ui-disabled",onclick:function(){i.onPasteBlock.bind(i,this)();this.blockActionsMenu.close()}.bind(this)}),new BX.Main.MenuItem({text:BX.Landing.Loc.getMessage("LANDING_BLOCKS_ACTIONS_FEEDBACK_BUTTON"),onclick:this.showFeedbackForm.bind(this)}),new BX.Main.MenuItem({delimiter:true}),new BX.Main.MenuItem({text:BX.Landing.Loc.getMessage("LANDING_BLOCKS_ACTIONS_SAVE_BLOCK_BUTTON_MSGVER_1"),className:!this.isSaveBlockInLibraryAllowed()?"landing-ui-disabled":"",onclick:function(){this.saveBlock();this.blockActionsMenu.close()}.bind(this)})]})}h(this.node,"landing-ui-hover");this.blockActionsMenu.show()},moveUp:function(e){var n=T(this.node,"block-wrapper");var s=this.node;if(n){var a=Promise.all([X(s,-C(n).height),X(n,C(s).height)]);a.then(function(){void t(s,{transform:null,transition:null});void t(n,{transform:null,transition:null});i(s,n);if(!e||typeof e==="object"){BX.Landing.Backend.getInstance().action("Landing::upBlock",{block:this.id,lid:this.lid,siteId:this.siteId},{code:this.manifest.code}).then((()=>{BX.Landing.History.getInstance().push()}))}}.bind(this))}},moveDown:function(e){var i=_(this.node,"block-wrapper");var s=this.node;if(!!i){var a=Promise.all([X(s,C(i).height),X(i,-C(s).height)]);a.then(function(){void t(s,{transform:null,transition:null});void t(i,{transform:null,transition:null});n(s,i);if(!e||typeof e==="object"){BX.Landing.Backend.getInstance().action("Landing::downBlock",{block:this.id,lid:this.lid,siteId:this.siteId},{code:this.manifest.code}).then((()=>{BX.Landing.History.getInstance().push()}))}}.bind(this))}},addPanel:function(e,t){if(!this.panels.contains(e)){this.panels.add(e);if(!t){if(e.id==="content_edit"&&window.parent){let t=BX.Landing.PageObject.getRootWindow();s(e.layout,t.document.body)}else{s(e.layout,this.node)}}else{i(e.layout,t)}}},getBlockFormId:function(){var e=this.node.querySelector("script[data-b24-form]");if(BX.Type.isDomNode(e)){var t=BX.Dom.attr(e,"data-b24-form");if(BX.Type.isStringFilled(t)){var n=t.split("/");if(BX.Type.isArray(n)&&n.length===3){var i="";var s=BX.Dom.attr(e.previousSibling.firstChild,"id");if(s){i=s.replace("b24-","")}return{id:n[1],type:n[0],code:n[2],instanceId:i}}}}e=this.node.querySelector("[data-b24form]");if(BX.Type.isDomNode(e)){t=BX.Dom.attr(e,"data-b24form");if(BX.Type.isStringFilled(t)){n=t.split("|");if(BX.Type.isArray(n)&&n.length===3){i="";s=BX.Dom.attr(e.querySelector(".b24-form > div[id]"),"id");if(s){i=s.replace("b24-","")}return{id:n[0],type:n[2]||"inline",code:n[1],instanceId:i}}}}return null},getCrmFormOptions:function(){var e=this.node.querySelector("[data-b24form-use-style]");var t=BX.Dom.attr(e,"data-b24form-use-style");var n=/--primary([\da-fA-F]{2})/;if(BX.Type.isDomNode(e)&&BX.Text.toBoolean(t)){var i=BX.Dom.attr(e,"data-b24form-design");if(BX.Type.isPlainObject(i)){var s=BX.Dom.style(document.documentElement,"--primary").trim();Object.entries(i.color).forEach((function(e){if(e[1]==="--primary"||e[1].match(n)!==null){i.color[e[0]]=e[1].replace("--primary",s)}}));return{data:{design:i}}}}return{}},isCrmFormPage:function(){return BX.Landing.Env.getInstance().getOptions().specialType==="crm_forms"},isCrmFormBlock:function(){return this.isCrmFormPage()&&BX.Dom.attr(this.node,"data-subtype")==="form"},isDefaultCrmFormBlock:function(){return BX.Dom.hasClass(this.node,"block-66-90-form-new-default")},onShowContentPanel:function(){var e=this.getBlockFormId();var t=BX.Text.capitalize(BX.Landing.Env.getInstance().getOptions().params.type);if(BX.Type.isPlainObject(e)&&t!=="SMN"){var n=BX.Landing.PageObject.getRootWindow();void function(){if(BX.Landing.UI.Panel.FormSettingsPanel){return Promise.resolve([n.BX.Landing.UI.Panel,BX.Landing.UI.Panel])}return Promise.all([n.BX.Runtime.loadExtension("landing.ui.panel.formsettingspanel"),BX.Runtime.loadExtension("landing.ui.panel.formsettingspanel")])}().then(function(t){var n=t[1].FormSettingsPanel;if(n){return n.getInstance().show({formId:e.id,instanceId:e.instanceId,formOptions:this.getCrmFormOptions(),block:this})}}.bind(this))}else{this.showContentPanel()}BX.Landing.UI.Panel.EditorPanel.getInstance().hide()},onStateChange:function(){if(this.isEnabled()){this.disable()}else{this.enable()}},isEnabled:function(){return this.active},enable:function(){this.active=true;u(this.node,"landing-block-disabled");let e=this.blockActionsMenu||this.sidebarActionsMenu;if(e){I(e.getMenuItem("show_hide").getLayout().text,BX.Landing.Loc.getMessage("ACTION_BUTTON_HIDE"))}v("BX.Landing.Block:changeState",[this.id,true]);BX.Landing.Backend.getInstance().action("Landing::showBlock",{block:this.id,lid:this.lid,siteId:this.siteId},{code:this.manifest.code})},disable:function(){this.active=false;h(this.node,"landing-block-disabled");let e=this.blockActionsMenu||this.sidebarActionsMenu;if(e){I(e.getMenuItem("show_hide").getLayout().text,BX.Landing.Loc.getMessage("ACTION_BUTTON_SHOW"))}v("BX.Landing.Block:changeState",[this.id,false]);BX.Landing.Backend.getInstance().action("Landing::hideBlock",{block:this.id,lid:this.lid,siteId:this.siteId},{code:this.manifest.code})},createCardLabel:function(e,t){var n=[];if(c(t.label)){n.push(t.label)}else if(d(t.label)){n=n.concat(t.label)}var i=this.nodes.filter((function(t){return e.contains(t.node)}));var s=[];n.forEach((function(e){var t=i.find((function(t){return t.manifest.code===e}));if(t){var n;if(t instanceof BX.Landing.Block.Node.Text){n=m("span",{props:{className:"landing-card-title-text"},html:G(m("div",{html:t.getValue()}).innerText)});s.push(n);b(t.getField(),"change",(function(e){n.innerHTML=G(m("div",{html:e}).innerText)}));return}if(t instanceof BX.Landing.Block.Node.Link){n=m("span",{props:{className:"landing-card-title-link"},html:G(t.getValue().text)});s.push(n);b(t.getField(),"change",(function(e){n.innerHTML=G(e.text)}));return}if(t instanceof BX.Landing.Block.Node.Icon){n=m("span",{props:{className:"landing-card-title-icon"},children:[m("span",{props:{className:t.getValue().classList.join(" ")}})]});s.push(n);b(t.getField(),"change",(function(e){n.firstChild.className="landing-card-title-icon "+e.classList.join(" ")}));return}if(t instanceof BX.Landing.Block.Node.Img){n=m("span",{props:{className:"landing-card-title-img"},attrs:{style:"background-color: #fafafa"},children:[m("img",{props:{src:t.getValue().src}})]});s.push(n);b(t.getField(),"change",(function(e){n.innerHTML="";n.appendChild(m("img",{props:{src:e.src}}))}))}}}),this);return m("div",{props:{className:"landing-card-title"},children:!l(s)?s:t.name})},initCards:function(){if(this.access<fe){return}this.cards.clear();this.forEachCard((function(e,t,n){var i=BX.clone(this.manifest.cards[t]);var s=A(t,"@",n);if(this.isDynamicCards(t)){i.allowInlineEdit=false}S(e);var a=new BX.Landing.Block.Card(e,i,s);this.cards.add(a);if(i.allowInlineEdit!==false){var o=new Q("cardAction","landing-ui-panel-block-card-action");o.show();a.addPanel(o);o.addButton(new ne("clone",{html:"&nbsp;",onClick:function(e){e.stopPropagation();if(a.manifest.sync){var t=a.manifest.sync;if(c(a.manifest.sync)){t=[a.manifest.sync]}if(d(t)){t.forEach((function(e){this.cloneCard(A(e,"@",n))}),this)}}this.cloneCard(s)}.bind(this),attrs:{title:BX.Landing.Loc.getMessage("LANDING_TITLE_OF_CARD_ACTION_CLONE")}}));o.addButton(new ne("remove",{html:"&nbsp;",onClick:function(e){e.stopPropagation();if(a.manifest.sync){var t=a.manifest.sync;if(c(a.manifest.sync)){t=[a.manifest.sync]}if(d(t)){t.forEach((function(e){this.removeCard(A(e,"@",n))}),this)}}this.removeCard(s)}.bind(this),attrs:{title:BX.Landing.Loc.getMessage("LANDING_TITLE_OF_CARD_ACTION_REMOVE")}}))}a.selector=s;a.sortIndex=n;this.adjustCardRemoveButton(s)}));this.cards.sort((function(e,t){return e.getIndex()>t.getIndex()}))},cloneCard:function(e,t){var i=this.cards.getBySelector(e);var s=i.panels.get("cardAction").buttons.get("clone");var a={block:this.id,selector:e,lid:this.lid,siteId:this.siteId};var r={code:this.manifest.code};var c=this;Le(s);let d=Promise.resolve();if(o(t)&&!t||!o(t)){a.preventHistory=0;d=BX.Landing.Backend.getInstance().action("Landing\\Block::cloneCard",a,r).then((e=>{BX.Landing.History.getInstance().push();return e}))}return d.then((function(){v("BX.Landing.Block:Card:beforeAdd",[c.createEvent({card:i.node})])})).then((function(){var e=BX.clone(i.node);S(e);n(e,i.node);return e})).then((function(e){ye(s);v("BX.Landing.Block:Card:add",[c.createEvent({card:e})]);c.initEntities();c.initStyles()})).catch((function(){ye(s);return Promise.reject()}))},removeCard:function(e,t){var n=this.cards.getBySelector(e);var i=n.panels.get("cardAction").buttons.get("remove");var s={block:this.id,selector:e,lid:this.lid,siteId:this.siteId};var a={code:this.manifest.code};var r=this;Le(i);let c=Promise.resolve();if(o(t)&&!t||!o(t)){s.preventHistory=0;c=BX.Landing.Backend.getInstance().action("Landing\\Block::removeCard",s,a).then((e=>{BX.Landing.History.getInstance().push();return e}))}return c.then((function(){v("BX.Landing.Block:Card:beforeRemove",[r.createEvent({card:n.node})]);S(n.node)})).then((function(){r.cards.remove(n);n.node.remove();r.initEntities();r.adjustCardRemoveButton(e)})).then((function(){var t=r.createEvent({data:{selector:e}});v("BX.Landing.Block:Card:remove",[t]);ye(i)})).catch((function(){ye(i);return Promise.reject()}))},adjustCardRemoveButton:function(e){var t=this.cards.getBySelector(e);if(t){var n=t.panels.get("cardAction");if(n){var i=BX.hasClass(t.node,"landing-block-card-carousel-element");var s=t.node.closest(".landing-block-node-carousel-container");if(!i||!s){var a=t.node.parentElement.children.length===1;if(a){n.buttons.get("remove").disable()}else{n.buttons.get("remove").enable()}}else{var o=s.querySelectorAll(".landing-block-card-carousel-element").length;if(o>1){n.buttons.get("remove").enable()}else{n.buttons.get("remove").disable()}}}}},addCard:function(e,t){var i=e.selector.split("@")[0]+(e.index>0?"@"+(e.index-1):"");var s={block:this.id,content:e.content,selector:i,lid:this.lid,siteId:this.siteId};var a={code:this.manifest.code};var r=e.container;var c=m("div",{html:e.content}).firstElementChild;var d=this;let l=Promise.resolve();if(o(t)&&!t||!o(t)){s.preventHistory=0;l=BX.Landing.Backend.getInstance().action("Landing\\Block::addCard",s,a).then((e=>{BX.Landing.History.getInstance().push();return e}))}return l.then((function(){v("BX.Landing.Block:Card:beforeAdd",[d.createEvent({card:c})])})).then((function(){var t;if(e.index<=0){t=d.cards.find((function(e){return e.selector.includes(i.split("@")[0])}));if(t){x(c,t.node.parentNode)}}else{t=d.cards.getBySelector(i.split("@")[0]+"@"+(e.index-1));if(t){n(c,t.node)}}S(r);d.initEntities();v("BX.Landing.Block:Card:add",[d.createEvent({card:c})])}))},forEachCard:function(e){var t=Object.keys(this.manifest.cards);t.map((function(t){var n=E(this.node.querySelectorAll(t));n.forEach((function(n,i){e.apply(this,[n,t,i])}),this)}),this)},initNodes:function(){if(this.access<fe){return}var e=[];this.forEachNodeElements((function(t,n,i){var s=this.nodes.getByNode(t);var o=A(n,"@",i);if(!s){var r=k(this.manifest.nodes[n].handler);var c=t.closest("[data-card-preset]");var l=D(this.manifest.nodes[n]);var h=false;l.sections=this.sections;if(c){var u=c.dataset.cardPreset;Object.keys(this.manifest.cards).forEach((function(e){if(c.matches(e)){if(a(this.manifest.cards[e].presets)&&a(this.manifest.cards[e].presets[u])&&d(this.manifest.cards[e].presets[u].disallow)){var t=this.manifest.cards[e].presets[u].disallow.find((function(e){return n===e}));if(t){l.allowInlineEdit=false;h=true}}}}),this)}var g=this.cards.some((function(e){var n=e.selector.split("@")[0];return this.isDynamicCards(n)&&e.node.contains(t)}),this);if(g){l.allowInlineEdit=false}else{var f=this.cards.some((function(e){return e.node.contains(t)}));if(!f){if(this.isDynamic()){l.allowInlineEdit=false}}}s=new r({node:t,manifest:l,selector:o,onChange:this.onNodeChange.bind(this),onChangeOptions:this.onNodeOptionsChange.bind(this),onAttributeChange:this.onAttributeChange.bind(this),onDesignShow:this.showStylePanel.bind(this),uploadParams:{action:"Block::uploadFile",block:this.id}});if(h){s.getField().layout.hidden=true}this.nodes.add(s)}s.selector=o;e.push(s)}));this.nodes.clear();e.forEach((function(e){this.nodes.add(e)}),this);this.nodes.sort((function(e,t){return e.getIndex()>t.getIndex()}))},onNodeOptionsChange:function(e){if(!l(e)){this.initStyles();var t={code:this.manifest.code};var n={};n.data=e;n.block=this.id;n.siteId=this.siteId;return BX.Landing.Backend.getInstance().action("Block::changeNodeName",n,t)}},forEachNodeElements:function(e){Object.keys(this.manifest.nodes).forEach((function(t){try{E(this.node.querySelectorAll(t)).forEach((function(n,i){if(!n.matches('[data-id="content_edit"] *')){e.apply(this,[n,t,i])}}),this)}catch(e){}}),this)},showContentPanel:function(e){var t=!!e&&e.nodes?e.nodes:null;var n=!!e&&e.name?e.name:null;var i=!!e&&e.nodesOnly?e.nodesOnly:false;var o=!!e&&e.showAll?e.showAll:false;var r=!!e&&e.compact;var c=!!e&&e.hideCheckbox;var d=this.panels.get("content_edit");if(!d){d=new Z("content_edit",{title:BX.Landing.Loc.getMessage("LANDING_CONTENT_PANEL_TITLE"),subTitle:this.manifest.block.name,onSaveHandler:this.onContentSave.bind(this),onCancelHandler:this.onContentCancel.bind(this)});var l=this.getBlockFormId();var h=BX.Text.capitalize(BX.Landing.Env.getInstance().getOptions().params.type);if(BX.Type.isPlainObject(l)&&h!=="SMN"){var u=new BX.UI.Button({text:BX.Landing.Loc.getMessage("LANDING_SHOW_FORM_EDITOR"),color:BX.UI.Button.Color.LIGHT_BORDER,round:true,className:"landing-ui-panel-top-button",onclick:function(){d.hide().then(function(){this.onShowContentPanel()}.bind(this))}.bind(this)});BX.Dom.style(u.render(),{position:"absolute",right:"50px"});BX.Dom.append(u.render(),d.header)}this.addPanel(d)}d.compact(r);d.clear();var g=this.getBlockFromRepository(this.manifest.code);if(g&&g.restricted){s(this.getRestrictedMessage(),d.content)}this.tmpContent=m("div",{props:{hidden:true}});this.content.appendChild(this.tmpContent);var f="";Object.keys(this.manifest.cards).forEach((function(e){var t=this.manifest.cards[e];if(a(t.presets)){Object.keys(t.presets).forEach((function(e){var n=t.presets[e];f+=n.html}),this)}}),this);this.tmpContent.innerHTML=f;this.initEntities();this.initCardsLabels();var p=this.getEditForms({nodes:t,formName:n,nodesOnly:i,showAll:o,hideCheckbox:c});p.forEach((function(e){d.appendForm(e)}));this.tmpContent.innerHTML="";d.show();setTimeout(function(){this.lastBlockState=this.fetchRequestData(d,true)}.bind(this),300)},createHistoryEntry:function(e){Promise.all([this.lastBlockState,e]).then(function(e){var t=e[0];var n=e[1];BX.Landing.History.getInstance().push(new BX.Landing.History.Entry({block:this.id,selector:"#block"+this.id,command:"updateBlockState",undo:t,redo:n}))}.bind(this));return Promise.resolve(D(e))},updateContent:function(e,t){let n=Promise.resolve();if(o(t)&&!t||!o(t)){n=BX.Landing.Backend.getInstance().action("Block::updateContent",{lid:this.lid,block:this.id,content:e.replaceAll(' style="',' bxstyle="'),preventHistory:0},{code:this.manifest.code})}const i=this.reload();return Promise.all([n,i])},updateBlockState:function(e,t){if(BX.type.isPlainObject(e)&&BX.type.isPlainObject(e.dynamicParams)){this.dynamicParams=D(e.dynamicParams)}else{this.dynamicParams={}}Promise.resolve(e).then(function(e){return t?e:this.createHistoryEntry(e)}.bind(this)).then(this.applyMenuChanges.bind(this)).then(this.applyContentChanges.bind(this)).then(this.applyCardsChanges.bind(this)).then(this.applyAttributeChanges.bind(this)).then(this.applySettingsChanges.bind(this)).then((e=>this.saveChanges.bind(this)(e,t))).then(this.reload.bind(this)).catch(console.warn);var n=this.panels.get("content_edit");if(n){var i=new W;n.forms.forEach((function(e){if(e.type!=="attrs"){i.add(e);if(e.childForms&&e.childForms.length>0){e.childForms.forEach((function(e){i.add(e)}))}}}));i.fetchFields().forEach((function(e){if(e.tag){var t=this.nodes.getBySelector(e.selector);if(t){t.onChangeTag(e.tag)}}}),this)}},getRestrictedMessage:function(){return m("div",{props:{className:"ui-alert ui-alert-warning"},html:BX.Landing.Loc.getMessage("LANDING_BLOCK_RESTRICTED_TEXT"),attrs:{style:"margin-bottom: 20px"}})},onStyleShow:function(){BX.Landing.UI.Panel.EditorPanel.getInstance().hide();if(this.isCrmFormPage()&&this.isCrmFormBlock()){var e=Object.entries(this.manifest.style.nodes).reduce((function(e,t){if(t[1].type==="crm-form"){return t[0]}return e}),null);if(e){this.showStylePanel(e)}else{this.showStylePanel(this.selector)}}else{this.showStylePanel(this.selector)}},getPostfix:function(){return""},expandTypeGroups:function(e){var t=[];if(!BX.type.isArray(e)){e=[e]}e.forEach((function(e){if(ve(e)){be(e).forEach((function(e){t.push(e)}))}else{t.push(e)}}));return t},createStyleForm:function(e,t,n){var i=this.forms.get(e);if(i){this.forms.remove(i)}var s=!!t.props?t.props:!!t.type?t.type:null;var a=!!t.title?t.title:!!t.name?t.name:"";if(!!s&&!!a){var o=new ie({frame:window,postfix:this.getPostfix()});i=new ae({id:e,title:a,selector:e,iframe:window});s=this.expandTypeGroups(s).reduce((function(e,t){if(!e.includes(t)){e.push(t)}return e}),[]);s.forEach((function(t){var s=pe(t);if(s===null){return}var a=this.styles.get(e);var r=o.createField({block:this,styleNode:a,selector:!n?this.makeRelativeSelector(e):e,property:s.property,multiple:s.multiple===true,style:t,pseudoElement:s["pseudo-element"],pseudoClass:s["pseudo-class"],attrKey:s.attrKey,type:s.type,subtype:s.subtype,title:s.name,items:s.items,help:s.help,onChange:c.bind(this),onReset:d.bind(this)});function c(t,n,o,r){if(t instanceof BX.Event.BaseEvent){return}var c=!!s.exclude?pe(s.exclude):null;if(c){i.fields.forEach((function(e){if(e.style===s.exclude){e.reset()}}))}const d=this.createEvent({data:{selector:e,value:t,items:n,postfix:o,affect:r,exclude:c}});v(window,"BX.Landing.Block:beforeApplyStyleChanges",[d]);a.setValue(t,n,o,r,c);const l={node:a.getNode(),data:a.getValue()};v("BX.Landing.Block:updateStyleWithoutDebounce",[this.createEvent(l)]);this.onStyleInputWithDebounce(l,false)}function d(t,i,s){BX.Landing.Backend.getInstance().action("Landing\\Block::getContentFromRepository",{code:this.manifest.code}).then(function(o){var r=document.createElement("div");r.id="fake";r.innerHTML=o;r.style.display="none";window.document.body.append(r);var d=null;var h=null;if(n){h="#fake > :first-child";d=r.firstElementChild}else{h="#fake "+e;var u=a.getElementIndex(a.getTargetElement());d=r.querySelectorAll(h)[u]}var g=new BX.Landing.UI.Style({iframe:window,selector:h,relativeSelector:h,node:d});l(g);var f=g.getValue();var m=[];var p=a.getValue();t.forEach((function(e){if(f.classList.indexOf(e.value)!==-1){m.push(e.value)}var t=p.classList.indexOf(e.value);if(t!==-1){delete p.classList[t]}}));f.classList=p.classList.concat(m);f.className=f.classList;c.bind(this)(f,t,i,s);r.remove()}.bind(this)).catch((function(e){console.error("Error on reset",e)}))}function l(e){e.setInlineProperty(r.getInlineProperties());e.setComputedProperty(r.getComputedProperties());e.setPseudoElement(r.getPseudoElement());var t=true;var n=e.getValue(true);if(r.getInlineProperties().length>0||r.getComputedProperties().length>0){r.setValue(n.style,t)}else{n.classList.forEach((e=>{if(s.items.some((t=>t.value===e))){if(!!r.buttons&&r.multiple===true){return}r.setValue(e,t)}}))}}l(a);i.addField(r)}),this);this.forms.add(i)}i.fields.forEach((function(e){if(e.popup){e.popup.close()}}));return i},initStyles:function(){if(this.access<ge){return}this.styles.clear();var e=new BX.Landing.UI.Style({id:this.selector,iframe:window,selector:this.selector,relativeSelector:this.selector,onClick:this.onStyleClick.bind(this,this.selector)});this.styles.add(e);if(a(this.manifest.style)&&a(this.manifest.style.nodes)){Object.keys(this.manifest.style.nodes).forEach((function(e){var t=new BX.Landing.UI.Style({id:e,iframe:window,selector:e,relativeSelector:this.makeRelativeSelector(e),onClick:this.onStyleClick.bind(this,e)});this.styles.add(t)}),this)}},onStyleClick:function(e){this.showStylePanel(e);var t=this.forms.get(e);if(t){BX.Landing.PageObject.getInstance().design().then((function(e){BX.Landing.UI.Panel.Content.scrollTo(e.content,null)}))}},makeRelativeSelector:function(e){return A(this.selector," ",e)},makeAbsoluteSelector:function(e){e=e||this.selector;e=U(e);var t=e===this.selector?" > :first-child":this.selector;return U(e.replace(t,"").replace("!",""))},saveStyles:function(e){const t=this.styles.fetchChanges();if(t.length){t.forEach((function(e){if(e.selector===this.selector){e.selector=e.selector.replace(" > :first-child","")}if(!e.isSelectGroup()&&e.selector!==this.makeAbsoluteSelector(this.selector)){e.selector=A(e.selector.split("@")[0],"@",e.getElementIndex(e.getNode()[0]))}if(e.isSelectGroup()){e.selector=e.selector.split("@")[0]}}),this);if(o(e)&&!e||!o(e)){const e=t.fetchValues();BX.Landing.Backend.getInstance().action("Landing\\Block::updateStyles",{block:this.id,data:e,lid:this.lid,siteId:this.siteId,preventHistory:0},{code:this.manifest.code}).then((()=>{BX.Landing.History.getInstance().push()}))}}},showStylePanel:function(e){var t=BX.Reflection.getClass("BX.Landing.UI.Panel.FormSettingsPanel");var n=t&&t.getInstance().isShown()||BX.Landing.Main.getInstance().isControlsExternal();var i=this.isBlockSelector(e);var s=this.getStyleOptions(e);this.isMultiselection=this.content.querySelectorAll(e).length>1;BX.Landing.PageObject.getInstance().design().then(function(e){e.clearContent();if(s.type==="crm-form"){var t=BX.Landing.PageObject.getRootWindow();return Promise.all([t.BX.Runtime.loadExtension("landing.formstyleadapter"),BX.Runtime.loadExtension("landing.formstyleadapter")]).then(function(t){var i=t[1].FormStyleAdapter;var s=new i({formId:this.getBlockFormId().id,instanceId:this.getBlockFormId().instanceId,currentBlock:this});return Promise.all([e.show(n),s.load()])}.bind(this)).catch((function(e){console.log(e)}))}return e.show(n).then((function(e){return[e]}))}.bind(this)).then(function(t){var n=t[0];var o=t[1];n.prepareFooter(this.isMultiselection);if(o){n.appendForm(o.getStyleForm());return}if(d(s.type)||c(s.type)){if(s.type.length){n.appendForm(this.createStyleForm(e,s,i))}}if(a(s.additional)){e=s.selector?s.selector:e;n.appendForm(this.createAdditionalForm({form:ae,selector:e,group:s.additional,attrsType:s.additional.attrsType,onChange:this.onAttributeChange.bind(this)}));return}if(d(s.additional)){s.additional.forEach((function(t){n.appendForm(this.createAdditionalForm({form:ae,selector:e,group:t,onChange:this.onAttributeChange.bind(this)}))}),this)}}.bind(this)).catch(function(e){if(BX.Type.isArrayFilled(e)){var t=510;var n=e.some((function(e){return String(e.code)===String(t)}));if(n){BX.Dom.append(this.getAccessMessage(),BX.Landing.UI.Panel.StylePanel.getInstance().content)}}}.bind(this))},getAccessMessage:function(){if(!this.accessMessage){this.accessMessage=BX.create({tag:"div",props:{className:"landing-ui-access-error-message"},children:[BX.create({tag:"div",props:{className:"landing-ui-access-error-message-text"},text:BX.Landing.Loc.getMessage("LANDING_CRM_ACCESS_ERROR_MESSAGE")})]})}return this.accessMessage},getStyleOptions:function(e){if(this.isBlockSelector(e)){return this.prepareBlockOptions(this.manifest.style.block)}return this.manifest.style.nodes[e]},createAdditionalForm:function(e){var t=new e.form({title:e.group.name,type:"attrs"});var n=[];if(!BX.Type.isUndefined(e.group.attrs)){n=e.group.attrs}else{e.attrsType.forEach((e=>{let t=Be(e);if(t){n.push(t)}}))}n.forEach((function(n){var i=n.selector||e.selector;var s;if(d(n.tabs)){var a=new le({tabs:n.tabs.map((function(t){return{id:j(),name:t.name,active:t.active,fields:t.attrs.map((function(t){return this.createAttributeField(t,t.selector||e.selector,e.onChange)}),this)}}),this)});t.addCard(a);return}s=this.createAttributeField(n,i,e.onChange);t.addField(s)}),this);BX.Event.EventEmitter.subscribe("BX.Landing.UI.Form.StyleForm:attributeChange",(e=>{var n=e.data;this.prepareAttributeValue(n,t)}));return t},prepareAttributeValue:function(e,t){var n=e.data.dependency;if(n){n.forEach((n=>{var i=e.getValue();var s=n["conditions"].indexOf(i);if(s>=0){t.fields.forEach((e=>{if(e.attribute===n["attribute"]){if(n["action"]==="changeValue"){var t=e.getValue();var i=n["attributeCurrentValues"].indexOf(t);if(i>=0){e.setValue(n["attributeNewValue"],true);this.onAttributeChange(e)}}}}))}}))}},prepareBlockOptions:function(e){e=a(e)?e:{};e=D(e);e.name=BX.Landing.Loc.getMessage("BLOCK_STYLE_OPTIONS");if(!a(e.type)&&!c(e.type)&&!d(e.type)){e.type=["display","background","padding-top","padding-bottom","padding-left","padding-right","margin-top"]}return e},createAttributeField:function(e,t,n){var i=this.createFieldFactory(t,n);var s=this.getElementBySelector(t);if(!s&&t.includes("@")){var a=t.split("@");var o=this.getElementsBySelector(a[0]);if(o.length&&o[parseInt(a[1])]){s=o[parseInt(a[1])]}}var r=D(e);if(r.value===null||r.value===undefined){r.value=""}if(s){var c=w(s,r.attribute);if(BX.Type.isNil(c)){c=N(s,r.attribute)}if(c!==null){r.value=c}}return i.create(r)},onAttributeChange:function(e){BX.Event.EventEmitter.emit("BX.Landing.UI.Form.StyleForm:attributeChange",e);clearTimeout(this.attributeChangeTimeout);if(!this.requestData){this.requestData={}}this.appendAttrFieldValue(this.requestData,e);Promise.resolve(this.requestData).then(this.applyAttributeChanges.bind(this)).then(this.saveChanges.bind(this)).then(this.reload.bind(this)).then(function(){this.requestData=null}.bind(this))},appendSettingsFieldValue:function(e,t){e["settings"]=e["settings"]||{};e["settings"][t.attribute]=t.getValue();return e},appendAttrFieldValue:function(e,t){var n=this.makeAbsoluteSelector(t.selector);var i=t.getValue();e[n]=e[n]||{};e[n]["attrs"]=e[n]["attrs"]||{};if(BX.Type.isArray(t.attribute)){t.attribute.forEach((function(s){var a=s.replace("data-","");var o=i[a];if(o!==undefined){try{o=M(o)}catch(e){o=t.getValue()[a]}e[n]["attrs"][s]=o}}))}else{try{i=M(i)}catch(e){i=t.getValue()}e[n]["attrs"][t.attribute]=i}return e},appendMenuValue:function(e,t){e[t.code]=t.serialize();return e},getElementBySelector:function(e){if(this.isBlockSelector(e)){return this.content}var t;try{t=this.node.querySelector(e)}catch(e){t=null}return t},getElementsBySelector:function(e){if(this.isBlockSelector(e)){return[this.content]}var t;try{t=E(this.node.querySelectorAll(e))}catch(e){t=[]}return t},isBlockSelector:function(e){return!e||e===this.selector||"#block"+this.id===e},createFieldFactory:function(e,t){return new BX.Landing.UI.Factory.FieldFactory({selector:!this.isBlockSelector(e)?this.makeRelativeSelector(e):e,uploadParams:{action:"Block::uploadFile",block:this.id,lid:BX.Landing.Main.getInstance().id,id:BX.Landing.Main.getInstance().options.site_id},linkOptions:{siteId:BX.Landing.Main.getInstance().options.site_id,landingId:BX.Landing.Main.getInstance().id,filter:{"=TYPE":BX.Landing.Main.getInstance().options.params.type}},onValueChange:t||function(){}})},deleteBlock:function(e){var n=this.panels.get("block_action").buttons.get("remove");n.loader=n.loader||new BX.Loader({target:n.layout,size:28});n.loader.show();h(n.text,"landing-ui-hide-icon");void t(n.loader.layout.querySelector(".main-ui-loader-svg-circle"),{"stroke-width":"4px"});void t(n.loader.layout.querySelector(".main-ui-loader-svg"),{"margin-top":"-10px"});BX.Landing.UI.Panel.EditorPanel.getInstance().hide();if(this.blockActionsMenu){BX.Main.MenuManager.destroy(this.blockActionsMenu.id)}if(this.sidebarActionsMenu){BX.Main.MenuManager.destroy(this.sidebarActionsMenu.id)}if(String(window.localStorage.getItem("landingBlockId"))===String(this.id)){window.localStorage.removeItem("landingBlockId")}let i=Promise.resolve();if(o(e)&&!e||!o(e)){i=BX.Landing.Backend.getInstance().action("Landing::markDeletedBlock",{block:this.id,lid:this.lid,siteId:this.siteId,preventHistory:0},{code:this.manifest.code}).then((e=>{BX.Landing.History.getInstance().push();return e}))}i.then((()=>{n.loader.hide();u(n.text,"landing-ui-hide-icon");var e=this.createEvent();v("BX.Landing.Block:remove",[e]);E(this.node.querySelectorAll(".landing-ui-panel")).forEach(F);BX.Landing.PageObject.getBlocks().remove(this);F(this.node);v("Landing.Block:onAfterDelete",[this]);v("BX.Landing.Block:afterRemove",[e])}),(()=>{n.loader.hide();u(n.text,"landing-ui-hide-icon")}))},getFormEditorAddBlockTour:function(){var e=BX.Landing.PageObject.getRootWindow();return new e.BX.UI.Tour.Guide({steps:[{target:'[data-id="save_settings"]',title:BX.Landing.Loc.getMessage("LANDING_FORM_EDITOR_ADD_BLOCK_TOUR_STEP_1_TITLE"),text:BX.Landing.Loc.getMessage("LANDING_FORM_EDITOR_ADD_BLOCK_TOUR_STEP_1_TEXT")}]})},addBlockAfterThis:function(){var e=BX.Landing.UI&&BX.Landing.UI.Panel&&BX.Landing.UI.Panel.FormSettingsPanel?BX.Landing.UI.Panel.FormSettingsPanel.getInstance():null;if(this.isCrmFormPage()&&e&&e.isShown()){if(!e.isChanged()){e.hide().then(function(){BX.Landing.Main.getInstance().showBlocksPanel(this,null,null,true)}.bind(this))}else{this.getFormEditorAddBlockTour().start()}}else{BX.Landing.Main.getInstance().showBlocksPanel(this)}},addBlockBeforeThis:function(){var e=BX.Landing.UI.Panel.FormSettingsPanel.getInstance();if(this.isCrmFormPage()&&e.isShown()){if(!e.isChanged()){e.hide().then(function(){BX.Landing.Main.getInstance().showBlocksPanel(this,null,null,true)}.bind(this))}else{this.getFormEditorAddBlockTour().start()}}else{BX.Landing.Main.getInstance().showBlocksPanel(this,null,null,true)}},getFormEditorDesignTour:function(){var e=BX.Landing.PageObject.getRootWindow();return new e.BX.UI.Tour.Guide({steps:[{target:'[data-id="save_settings"]',title:BX.Landing.Loc.getMessage("LANDING_FORM_EDITOR_FORM_DESIGN_TOUR_STEP_1_TITLE"),text:BX.Landing.Loc.getMessage("LANDING_FORM_EDITOR_FORM_DESIGN_TOUR_STEP_1_TEXT")}]})},onFormDesignClick:function(){var e=Object.entries(this.manifest.style.nodes).reduce((function(e,t){if(t[1].type==="crm-form"){return t[0]}return e}),null);if(e){this.showStylePanel(e)}else{this.showStylePanel(this.selector)}},onNodeChange:function(e,t){const n=this.createEvent({node:e.node});v("BX.Landing.Block:Node:update",[n]);if(!e.isSavePrevented()){clearTimeout(this.changeTimeout);this.changedNodes.add(e);this.changeTimeout=setTimeout((()=>{if(o(t)&&!t||!o(t)){BX.Landing.Backend.getInstance().action("Landing\\Block::updateNodes",{block:this.id,data:this.changedNodes.fetchValues(),additional:this.changedNodes.fetchAdditionalValues(),lid:this.lid,siteId:this.siteId,preventHistory:0},{code:this.manifest.code})}this.changedNodes.clear()}),300)}},containsPseudoSelector:function(e){return Object.keys(e).some((function(e){var t;if(e==="cards"){return false}if(e==="dynamicState"){return false}if(BX.type.isPlainObject(this.manifest.menu)&&e in this.manifest.menu){return false}try{if(e!=="#block"+this.id&&e!==""){t=!this.node.querySelector(e)}else{t=false}}catch(n){t=!ke(e)}return t}),this)},containsReloadRequireAttributes:function(e){if(a(e)&&a(this.manifest)&&a(this.manifest.attrs)){return Object.keys(this.manifest.attrs).some((function(t){return this.manifest.attrs[t].some((function(n){if(n.requireReload&&a(e[t])&&a(e[t].attrs)&&e[t].attrs[n.attribute]){return true}return false}),this)}),this)}return false},applyContentChanges:function(e){if(!a(e)){return Promise.reject(new TypeError("BX.Landing.Block.applyContentChanges: data isn't object"))}var t=D(e);Object.keys(t).forEach((function(e){if(!ke(e)){delete t[e]}}));if(!l(t)){var n=this.createEvent({data:t});v(window,"BX.Landing.Block:beforeApplyContentChanges",[n])}var i=[];Object.keys(e).forEach((function(t){if(ke(t)){var n=this.nodes.getBySelector(t);if(n){var s=n.setValue(e[t],true,true);n.preventSave(false);if(s){i.push(s);s.then((function(){e[t]=n.getValue()}))}else{e[t]=n.getValue()}}}}),this);return Promise.all(i).then((function(){return e}))},applyMenuChanges:function(e){if(!a(e)){return Promise.reject(new TypeError("BX.Landing.Block.applyContentChanges: data isn't object"))}var t=Object.keys(this.manifest.menu||{});if(t.length>0){t.forEach(function(t){if(t in e){var n=this.menu.find((function(e){return e.code===t}));n.rebuild(e[t])}}.bind(this));e.forceReload=true}this.initMenu();return Promise.resolve(e)},applyCardsChanges:function(e){if(!a(e)){return Promise.reject(new TypeError("BX.Landing.Block.applyCardsChanges: data isn't object"))}var t=[];if("cards"in e&&a(e.cards)){v("BX.Landing.Block:Cards:beforeUpdate",[this.createEvent()]);var n={};Object.keys(e.cards).forEach((function(i){var o=this.node.querySelector(i).parentElement;var r=this.node.querySelectorAll(i);var d=e.cards[i].values;var h=e.cards[i].presets;var u=e.cards[i].indexes;var g=e.cards[i].source;o.innerHTML="";Object.keys(d).forEach((function(e){g[e]={value:0,type:"card"};if(!l(h)&&!l(h[e])){if(!r[u[e]]||!BX.type.isString(u[e])){g[e].type="preset";g[e].value=h[e];return}}if(r[u[e]]){g[e].type="card";g[e].value=u[e]}}),this);Object.keys(d).forEach((function(e){if(g[e].type==="preset"){var t=this.manifest.cards[i]["presets"][g[e].value]["html"];s(R(t),o);return}s(D(r[g[e].value]),o)}),this);this.initNodes();this.initCards();this.initGroups();Object.keys(d).forEach((function(e){var i=d[e];Object.keys(i).forEach((function(e){n[e]=e in n?n[e]+1:0;var s=this.nodes.getBySelector(A(e,"@",n[e]));if(s){var o=i[e];var r=s.getValue();if(a(o)&&c(o.url)){o.url=O(o.url)}if(a(r)&&c(r.url)){r.url=O(r.url)}try{o=JSON.stringify(o)}catch(t){o=i[e]}try{r=JSON.stringify(r)}catch(e){r=s.getValue()}var d=s.setValue(i[e],true,true)||Promise.resolve();s.preventSave(false);d.then(function(t,n,a){i[A(t,"@",n)]=s.getValue();if(s.manifest.type==="img"||s.manifest.type==="icon"){i[A(t,"@",n)]["url"]=M(a["url"])}delete i[e]}.bind(this,e,n[e],i[e]));t.push(d)}}),this)}),this);Promise.all(t).then(function(){this.initCardsLabels();this.initStyles();delete e.cards[i].presets;delete e.cards[i].indexes}.bind(this))}),this);Promise.all(t).then(function(){v("BX.Landing.Block:Cards:update",[this.createEvent()])}.bind(this))}return Promise.all(t).then((function(){return Promise.resolve(e)}))},applySettingsChanges:function(e){if(!a(e)){return Promise.reject(new TypeError("BX.Landing.Block.applyAttributeChanges: requestData isn't object"))}if(a(e.settings)&&!l(e.settings)){if(e.settings.id){this.content.id=e.settings.id}}return Promise.resolve(e)},applyAttributeChanges:function(e){if(!a(e)){return Promise.reject(new TypeError("BX.Landing.Block.applyAttributeChanges: requestData isn't object"))}var t=D(e);Object.keys(e).forEach((function(n){if(!(a(e[n])&&"attrs"in e[n])){delete t[n]}}));if(!l(t)){var n=this.createEvent({data:t});v(window,"BX.Landing.Block:beforeApplyAttributesChanges",[n])}var i=this;Object.keys(e).forEach((function(t){if(a(e[t])&&"attrs"in e[t]){var n=i.getElementsBySelector(t);if(!n.length&&t.includes("@")){var s=t.split("@");n=i.getElementsBySelector(s[0]);if(n[parseInt(s[1])]){n=[n[parseInt(s[1])]]}}Object.keys(e[t].attrs).forEach((function(s){n.forEach((function(n){var a=O(e[t]["attrs"][s]);if(!s.includes("data-")){N(n,s,a)}else{w(n,s,a)}v("BX.Landing.Block:Node:updateAttr",[i.createEvent({node:n,data:e[t]["attrs"]})])}))}))}}));return Promise.resolve(e)},saveChanges:function(e,t){if(!a(e)){return Promise.reject(new TypeError("BX.Landing.Block.saveChanges: data isn't object"))}if(Object.keys(e).length){var n={code:this.manifest.code};var i={block:this.id,data:e,lid:this.lid,siteId:this.siteId};var s={};if(a(e.settings)&&!l(e.settings)){if(e.settings.id){s.changeAnchor={action:"Block::changeAnchor",data:{block:this.id,lid:this.lid,data:e.settings.id}}}delete e.settings}if(!l(e)){var r=new H;Object.keys(i).forEach((function(e){r.add(this.nodes.getBySelector(e))}),this);s.updateNodes={action:"Block::updateNodes",data:i,additional:r.fetchAdditionalValues()}}if(!l(e.cards)){var c=D(e.cards);delete e.cards;var d=BX.Landing.Utils.arrayUnique(Object.keys(c));d=d.length===1?d+" *":d.join(" *, ");var h=this.nodes.matches(d).fetchAdditionalValues();s.updateCards={action:"Block::updateCards",data:{block:this.id,lid:this.lid,siteId:this.siteId,data:c,additional:h}}}if(e.cardsFirst){var u=s;s={};if(u.changeAnchor){s.changeAnchor=u.changeAnchor}if(u.updateCards){s.updateCards=u.updateCards}if(u.updateNodes){s.updateNodes=u.updateNodes}delete e.cardsFirst}if(o(t)&&!t||!o(t)){return BX.Landing.Backend.getInstance().batch("Landing\\Block::updateNodes",s,n).then((function(){return Promise.resolve(e)}))}}return Promise.resolve(e)},fetchRequestData:function(e,t){var n={};var i={};var s=function(e,t){return t?e:e.fetchChanges()};i.attrs=new W;i.cards=new W;i.dynamicCards=new W;i.dynamicBlock=new W;i.content=new W;i.settings=new W;i.menu=new W;e.forms.forEach((function(e){i[e.type].push(e)}));s(i.content.fetchFields(),t).reduce(V(this.appendContentFieldValue,this),n);var a=new q;i.cards.forEach((function(e){e.childForms.forEach((function(e){e.fields.forEach((function(e){if(e.type==="attr"){a.add(e)}}))}))}));s(a,true).reduce(V(this.appendAttrFieldValue,this),n);i.cards.reduce(V(this.appendCardsFormValue,this),n);i.dynamicCards.reduce(V(this.appendDynamicCardsFormValue,this),n);i.dynamicBlock.reduce(V(this.appendDynamicBlockFormValue,this),n);s(i.attrs.fetchFields(),t).reduce(V(this.appendAttrFieldValue,this),n);s(i.settings.fetchFields(),t).reduce(V(this.appendSettingsFieldValue,this),n);i.menu.reduce(V(this.appendMenuValue,this),n);n.dynamicState=Object.keys(this.manifest.cards).reduce((function(e,t){e[t]=BX.type.isPlainObject(n.dynamicParams)&&t in n.dynamicParams;return e}),{});n.dynamicState.wrapper=!!n.dynamicParams&&"wrapper"in n.dynamicParams;return Promise.resolve(n)},appendContentFieldValue:function(e,t){return e[t.selector]=t.getValue(),e},appendCardsFormValue:function(e,t){e.cards=e.cards||{};e.cards[t.code]={};e.cards[t.code]["values"]=t.serialize();e.cards[t.code]["presets"]=t.getUsedPresets();e.cards[t.code]["indexes"]=t.getIndexesMap();e.cards[t.code]["source"]={};return e},appendDynamicCardsFormValue:function(e,t){e.dynamicParams=e.dynamicParams||{};e.dynamicParams[t.code]={};e.dynamicParams[t.code]=t.serialize();return e},appendDynamicBlockFormValue:function(e,t){e.dynamicParams=e.dynamicParams||{};e.dynamicParams.wrapper=t.serialize();return e},reload:function(e){if(a(e)){var t=this.containsPseudoSelector(e)||this.containsReloadRequireAttributes(e);if(!t){return Promise.resolve(e)}}var n=new BX.Loader({target:this.parent.parentElement,color:"rgba(255, 255, 255, .8)"});n.layout.style.position="fixed";n.layout.style.zIndex="999";n.show();BX.Landing.Main.getInstance().showOverlay();var i=this;return BX.Landing.Backend.getInstance().action("Block::getContent",{block:this.id,lid:this.lid,siteId:this.siteId,editMode:1}).then(function(e){var t=this.createEvent();v("BX.Landing.Block:remove",[t]);BX.Landing.Main.getInstance().currentBlock=i;BX.Landing.Main.getInstance().currentArea=i.parent;return BX.Landing.Main.getInstance().addBlock(e,true)}.bind(this)).then((function(t){i.node=t;return Promise.resolve(e)})).then((function(e){return new Promise((function(t){setTimeout((function(){t(e);n.hide();BX.Landing.Main.getInstance().hideOverlay()}),800)}))}))},onContentSave:function(){var e=this.panels.get("content_edit");if(e){e.hide();this.fetchRequestData(e).then(function(e){v("BX.Landing.Block:onContentSave",[this.id]);return Object.assign({},e,{cardsFirst:true})}.bind(this)).then(this.updateBlockState.bind(this))}},onContentCancel:function(){this.panels.get("content_edit").hide();this.tmpContent.innerHTML="";this.anchor=this.savedAnchor},getCardsSelector:function(){var e=Object.keys(this.manifest.cards);var t=A(e.join(","),", ");var n=A(e.join(" *,")," *");return A(t,n)},onStyleInput:function(e,t){this.saveStyles(t);const n=this.createEvent(e);v("BX.Landing.Block:updateStyle",[n])},getBlockEditForm:function(e){var t={};if(BX.type.isPlainObject(e)){t=Object.assign({},e)}var n=t.nodes||this.nodes;if(this.cards.length>0&&!e.hideCheckbox){n=this.nodes.notMatches(this.getCardsSelector())}var i=Object.keys(this.manifest.nodes);n=i.reduce((function(e,t){if(!t.includes(":")){n.matches(t).getVisible().filter((function(e){return e.manifest.allowFormEdit!==false})).forEach((function(t){e.push(t)}))}return e}),new H);var s=this.onBlockFormTypeChange.bind(this);var a=!!(!e.skipBlockState&&BX.type.isPlainObject(this.dynamicParams)&&this.dynamicParams.wrapper);var o="";var r=BX.Landing.Main.getInstance().options.helps;if(BX.type.isPlainObject(r)){o=r.DYNAMIC_BLOCKS}var c={text:BX.Landing.Loc.getMessage("LANDING_BLOCK__MAKE_A_DYNAMIC"),onChange:s,state:a,help:o};var d=new se({title:e.formName||BX.Landing.Loc.getMessage("BLOCK_ELEMENTS"),description:this.manifest.block.formDescription,type:"content",code:this.id,headerCheckbox:function(){if(!e.hideCheckbox&&this.manifest.block.dynamic!==false){return c}return undefined}.bind(this)()});if(a){setTimeout((function(){s({form:d,state:true})}))}n.forEach((function(e){d.addField(e.getField())}));return d},getMenuEditForms:function(){return this.menu.map((function(e){return e.getForm()}),this)},getAttrsEditForm:function(){var e=Object.keys(this.manifest.attrs);var t=[];e.forEach((function(e){var n=this.manifest.attrs[e];if(!n.hidden){n=!d(n)?[n]:n;n.forEach((function(n){if(!n.hidden&&c(n.type)){t.push(this.createAttributeField(n,n.selector||e))}}),this)}}),this);var n=new se({id:"attr",type:"attrs",title:BX.Landing.Loc.getMessage("BLOCK_SETTINGS"),description:this.manifest.block.attrsFormDescription});t.forEach((function(e){n.addField(e)}));return n},getAttrsAdditionalEditForms:function(){var e=Object.keys(this.manifest.attrs);var t=[];e.forEach((function(e){var n=this.manifest.attrs[e];if(!n.hidden){n=!d(n)?[n]:n;n.forEach((function(n){if(!n.hidden&&c(n.type)){return}if(c(n.name)&&n.attrs){t.push(this.createAdditionalForm({form:se,selector:e,group:n,onChange:function(){}}))}}),this)}}),this);return t},getCardsEditForms:function(e){var t=Object.keys(this.manifest.cards);var n=Object.keys(this.manifest.nodes);var i=[];var s=t.reduce(function(e,t){var n=this.cards.filter((function(e){return e.selector.split("@")[0]===t}));if(n.length>0){n.sort((function(e,t){return e.sortIndex-t.sortIndex}));e.set(t,n)}return e}.bind(this),new Map);s.forEach((function(t,s){var o=BX.type.isPlainObject(this.dynamicParams)&&s in this.dynamicParams&&!e;var r=this.onCardsFormTypeChange.bind(this);var c=this.manifest.cards[s]["group_label"];var l="";var h=BX.Landing.Main.getInstance().options.helps;if(BX.type.isPlainObject(h)){l=h.DYNAMIC_BLOCKS}var u={text:BX.Landing.Loc.getMessage("LANDING_CARDS__MAKE_A_DYNAMIC"),onChange:r,state:o,help:l};var g=new re({title:c||BX.Landing.Loc.getMessage("LANDING_CARDS_FROM_TITLE"),code:s.split("@")[0],presets:t[0].manifest.presets,sync:t[0].manifest.sync,description:t[0].manifest.formDescription,forms:i,headerCheckbox:function(){if(this.manifest.block.dynamic!==false){return u}return undefined}.bind(this)()});i.push(g);if(o){setTimeout((function(){r({form:g,state:true})}))}t.forEach((function(e){var t=new oe({label:e.getLabel()||e.getName(),labelBindings:e.manifest.label,selector:e.selector,preset:e.preset});var i=new H;var o=this.nodes.filter((function(t){return e.node.contains(t.node)}));if(o.length){n.forEach((function(e){var t=o.matches(e);t.forEach(i.add,i)}),this);i.forEach((function(e){if(e.manifest.allowFormEdit!==false){t.addField(e.getField())}}));var r=this.manifest.cards[s].additional;if(a(r)){if(d(r.attrs)){r.attrs.forEach((function(n){var i=this.createAttributeField(n,e.selector,(function(){}));i.type="attr";t.addField(i)}),this)}}if(this.tmpContent.contains(e.node)){g.addPresetForm(t)}else{g.addChildForm(t)}}}),this)}),this);return i},getBlockSettingsForm:function(){var e=new se({title:BX.Landing.Loc.getMessage("BLOCK_SETTINGS"),type:"settings"});var t=this.createFieldFactory("!"+this.selector);var n=null;var i=BX.Landing.Main.getInstance().options.url;if(i[0]==="/"){i=top.location.origin+i}this.savedAnchor=this.anchor||this.node.id;var a=A(i,"#",this.anchor||this.node.id);var o=t.create({type:"text",name:BX.Landing.Loc.getMessage("BLOCK_SETTINGS_ANCHOR_FIELD"),description:"<span class='landing-ui-anchor-preview'>"+BX.Text.encode(a)+"</span>",attribute:"id",value:this.anchor||this.node.id,onInput:function(){var e=o.layout.querySelector(".landing-ui-anchor-preview");if(e){e.innerHTML=BX.Text.encode(A(i,"#",BX.Text.decode(o.getValue())))}this.anchor=o.getValue();if(n){F(n)}if(this.node.id!==o.getValue()&&document.getElementById(o.getValue())){n=BX.Landing.UI.Field.BaseField.createDescription(BX.Landing.Loc.getMessage("BLOCK_SETTINGS_ANCHOR_FIELD_VALIDATE_ERROR"));h(n,"landing-ui-error");s(n,o.layout)}if(!K(o.getValue())){n=BX.Landing.UI.Field.BaseField.createDescription(BX.Landing.Loc.getMessage("BLOCK_SETTINGS_ANCHOR_FIELD_VALIDATE_INVALID_ID"));h(n,"landing-ui-error");s(n,o.layout)}}.bind(this)});e.addField(o);return e},getEditForms:function(e){var t={};if(BX.type.isPlainObject(e)){t=Object.assign({},e)}if(arguments.length>1){t.nodes=arguments[0];t.formName=arguments[1];t.nodesOnly=arguments[2];t.showAll=arguments[3];t.skipCardsState=arguments[4];t.skipBlockState=arguments[5]}var n=new W;if(this.access>=fe){var i=!(l(this.manifest.nodes)&&l(this.manifest.attrs)&&l(this.manifest.menu));if(i){var s=this.getBlockEditForm(t);if(s.fields.length>0){n.add(s)}var a=this.getMenuEditForms(t);if(a.length>0){a.forEach((function(e){n.add(e)}))}if(!t.nodesOnly){var o=this.getAttrsEditForm();if(o.fields.length>0){n.add(o)}var r=this.getAttrsAdditionalEditForms();if(r.length>0){r.forEach((function(e){n.add(e)}))}var c=this.getCardsEditForms(t.skipCardsState);if(c.length>0){c.forEach((function(e){n.add(e)}))}}}var d=this.getBlockSettingsForm();if(d.fields.length>0){n.push(d)}}return n},isLastBlockInArea:function(){return this.parent.querySelectorAll(".block-wrapper").length<2},onBlockRemove:function(){this.adjustSortButtonsState()},adjustSortButtonsState:function(){var e=this.panels.get("block_action");if(e){if(this.isLastBlockInArea()){e.buttons.get("up").disable();e.buttons.get("down").disable()}else{e.buttons.get("up").enable();e.buttons.get("down").enable()}}},getFieldType:function(e){var t=this.nodes.getBySelector(e.selector);if(t){return t.type}return null},getTypeReferences:function(e,t){return e.filter((function(e){return e.type===t}))},convertReferencesToDropdownItems:function(e){var t=e.map((function(e){return{name:e.name,value:e.id}}));t.push({name:BX.Landing.Loc.getMessage("LANDING_BLOCK__DYNAMIC_REFERENCE_HIDE"),html:'<span class="landing-ui-field-dropdown-sep"></span>'+BX.Landing.Loc.getMessage("LANDING_BLOCK__DYNAMIC_REFERENCE_HIDE"),value:"@hide"});return t},getDefaultDropdownItems:function(){return[{name:BX.Landing.Loc.getMessage("LANDING_CARDS__DYNAMIC_FIELD_NOT_SET"),value:""}]},getDynamicFiledValue:function(e,t){var n=this.dynamicParams||{};if(BX.type.isPlainObject(n[e])&&BX.type.isPlainObject(n[e].references)){return n[e].references[t]}},convertToDynamicFields:function(e,t,n){return e.map((function(e){var i=this.getFieldType(e);if(i!=="text"&&i!=="img"&&i!=="link"&&i!=="link_ref"){return e}var s=this.getTypeReferences(n,i);var a=this.convertReferencesToDropdownItems(s);var o=this.getDynamicFiledValue(t,e.selector);if(i==="link"){if(BX.type.isPlainObject(s[0])&&BX.type.isArray(s[0].actions)){return new BX.Landing.UI.Field.ClickAction({title:e.title,selector:e.selector,reference:s[0],linkField:e,value:o})}return e}if(a.length===0){a=this.getDefaultDropdownItems()}if(i==="img"){return new BX.Landing.UI.Field.DynamicImage({title:e.title,selector:e.selector,dropdownItems:a,value:BX.type.isString(o)?{id:o}:o,hideCheckbox:t==="wrapper"})}return new BX.Landing.UI.Field.DynamicDropdown({title:e.title,selector:e.selector,dropdownItems:a,value:BX.type.isString(o)?{id:o}:o,hideCheckbox:t==="wrapper"||i==="link_ref"})}),this)},createDynamicCardsForm:function(e){var t="";var n=BX.Landing.Main.getInstance().options.helps;if(BX.type.isPlainObject(n)){t=n.DYNAMIC_BLOCKS}var i=new BX.Landing.UI.Form.DynamicCardsForm({title:e.title,code:e.code,type:"dynamicCards",dynamicParams:e.dynamicParams,headerCheckbox:{text:BX.Landing.Loc.getMessage("LANDING_CARDS__MAKE_A_DYNAMIC"),onChange:this.onCardsFormTypeChange.bind(this),state:true,help:t},onSourceChange:function(t){var n=this.convertToDynamicFields(e.form.childForms[0].fields,e.code,t.references);var s=new he({id:"references",items:n});var a=i.detailPageGroup.fields[0];if(!BX.Type.isStringFilled(a.getValue().href)){var o={text:"",href:""};if(t&&t.default&&t.default.detail){o.href=t.default.detail}a.setValue(o);a.hrefInput.makeDisplayedHrefValue()}var r=i.cards.get("references");i.replaceCard(r,s)}.bind(this)});return i},onCardsFormTypeChange:function(e){var t=this.panels.get("content_edit");var n=!!e.state;if(n){var i={};if(BX.type.isPlainObject(this.dynamicParams)&&this.dynamicParams[e.form.code]){i=this.dynamicParams[e.form.code]}var s=Object.assign({},i);if(BX.type.isPlainObject(s.settings)){if(!("pagesCount"in s.settings)){s.settings.pagesCount=e.form.childForms.length}}else{s.settings={pagesCount:e.form.childForms.length}}var a=this.createDynamicCardsForm({title:e.form.title,code:e.form.code,form:e.form,dynamicParams:s});t.replaceForm(e.form,a);return}delete this.dynamicParams[e.form.code];var o=this.getCardsEditForms(true).find((function(t){return t.code===e.form.code}));t.replaceForm(e.form,o)},isDynamicCards:function(e){return e in this.dynamicParams},onBlockFormTypeChange:function(e){var t=this.panels.get("content_edit");var n=!!e.state;let i=this.content.parentElement.querySelector(".landing-html-lock");if(i){if(!n){this.content.style.display="flex";i.style.display="none"}else{this.content.style.display="none";i.style.display="flex"}}if(n){var s=this.createDynamicBlockForm({title:e.form.title,code:e.form.code,form:e.form,dynamicParams:this.dynamicParams});t.replaceForm(e.form,s);return}delete this.dynamicParams.wrapper;var a=this.getBlockEditForm({skipBlockState:true});t.replaceForm(e.form,a)},createDynamicBlockForm:function(e){var t="";var n=BX.Landing.Main.getInstance().options.helps;if(BX.type.isPlainObject(n)){t=n.DYNAMIC_BLOCKS}var i=new BX.Landing.UI.Form.DynamicBlockForm({title:e.title,code:this.id,type:"dynamicBlock",dynamicParams:e.dynamicParams,headerCheckbox:{text:BX.Landing.Loc.getMessage("LANDING_BLOCK__MAKE_A_DYNAMIC"),onChange:this.onBlockFormTypeChange.bind(this),state:true,help:t},onSourceChange:function(t){var n=i.cards.get("references");if(BX.type.isPlainObject(t)){var s=this.convertToDynamicFields(e.form.fields,"wrapper",t.references);var a=new he({id:"references",items:s});i.replaceCard(n,a);return}i.removeCard(n)}.bind(this)});return i},isDynamic:function(e){e=e||this.id;var t=this.panels.get("content_edit");if(t){var n=t.forms.toArray().find((function(t){return t.code===e}));if(n){return n.isCheckboxChecked()}}e=e===this.id?"wrapper":e;return!!this.dynamicParams&&e in this.dynamicParams}}})();
//# sourceMappingURL=block.map.js